﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Marbles.Web.Admin.Content
{
    public partial class UrlShort : ContentBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void cBtnGo_Click(object sender, EventArgs e)
        {
            Core.Content.UrlShorten.GoogleURLShortener shortener = new Core.Content.UrlShorten.GoogleURLShortener();
            string url = shortener.Shorten(cTxtLongUrl.Text);
            cTxtShortUrl.Text = url;
            cTxtShortUrl.Focus();
            cLtScript.Visible = true;
            cLtScript.Text = string.Format("<script language=\"javascript\">document.getElementById('{0}').focus();document.getElementById('{0}').select();</script>", cTxtShortUrl.ClientID);
        }
    }
}